home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / snip0493.zip / DOW.H < prev    next >
Text File  |  1993-04-05  |  525b  |  18 lines

  1. /*
  2. ** DOW.H - day-of-week macro.  From the FidoNet CECHO - by
  3. ** Paul Schlyter.
  4. */
  5.  
  6. #ifdef ISO        /* International Monday-Sunday calendars    */
  7.  
  8.  #define dow(y,m,d)  \
  9.         ( ( ( 3*(y) - (7*((y)+((m)+9)/12))/4 + (23*(m))/9 + (d) + 2    \
  10.         + (((y)-((m)<3))/100+1) * 3 / 4 - 16 ) % 7 ) )
  11.  
  12. #else            /* Sunday-Saturday (i.e. U.S.) calendars    */
  13.  
  14.  #define dow(y,m,d)  \
  15.         ( ( ( 3*(y) - (7*((y)+((m)+9)/12))/4 + (23*(m))/9 + (d) + 2    \
  16.         + (((y)-((m)<3))/100+1) * 3 / 4 - 15 ) % 7 ) )
  17. #endif
  18.